package com.lanou.interceptor;

import org.springframework.web.servlet.HandlerInterceptor;
import org.springframework.web.servlet.ModelAndView;

/**
 * @author 姚云鹏
 * Create at: 2018/6/11 17:05
 */
public class DemoInterceptor implements HandlerInterceptor {
    @Override
    public boolean preHandle(javax.servlet.http.HttpServletRequest
                                         httpServletRequest, javax.servlet.http
            .HttpServletResponse httpServletResponse, Object o) throws Exception {

        System.out.println("preHandle..............................");
        return true;
    }

    @Override
    public void postHandle(javax.servlet.http.HttpServletRequest
                                       httpServletRequest, javax.servlet.http
            .HttpServletResponse httpServletResponse, Object o, ModelAndView modelAndView) throws Exception {
        System.out.println("postHandle..............................");

    }

    @Override
    public void afterCompletion(javax.servlet.http.HttpServletRequest
                                            httpServletRequest, javax.servlet.http.HttpServletResponse httpServletResponse, Object o, Exception e) throws Exception {
        System.out.println("afterCompletion..............................");

    }
}
